package org.clockworkmages.games.anno1186.generator.sets;

import org.clockworkmages.games.anno1186.DamageConstants;
import org.clockworkmages.games.anno1186.TimeConstants;
import org.clockworkmages.games.anno1186.dao.GameObjectsList;
import org.clockworkmages.games.anno1186.generator.GameObjectGenerator;
import org.clockworkmages.games.anno1186.model.character.SkillConstants;
import org.clockworkmages.games.anno1186.model.character.StatConstants;
import org.clockworkmages.games.anno1186.model.effect.Effect;
import org.clockworkmages.games.anno1186.model.item.Item;
import org.clockworkmages.games.anno1186.model.item.ItemConstants;
import org.clockworkmages.games.anno1186.model.option.GenericOption;
import org.clockworkmages.games.anno1186.scripting.tools.EffectBuilder;
import org.clockworkmages.games.anno1186.scripting.tools.ScriptBuilder;

public class BasicItems
		extends GameObjectGenerator
		//
		implements StatConstants, SkillConstants, TechnicalSituationConstants,
		TimeConstants, ItemConstants, DamageConstants {

	public String getFileName() {
		return "basicItems";
	}

	@Override
	public GameObjectsList generate() {
		GameObjectsList gameObjects = new GameObjectsList();

		GenericOption useOption;
		Item item;
		Effect effect;

		item = new Item("DAGGER", "Dagger", "A simple dagger, small but sharp");
		item.setEquipmentSlotId(EQUIPMENT_SLOT_R_HAND);
		item.setItemType(ITEM_TYPE_DAGGER);
		item.setValue(10);
		effect = new Effect(ScriptBuilder.NEW().me()
				.modifyDamage(PHYSICAL, 2, 2).toString());
		item.getEquippedEffects().add(effect);
		effect = new Effect(ScriptBuilder.NEW().me()
				.modifyDerivate(D_ATTACK_STAMINA_COST, 1).toString());
		item.getEquippedEffects().add(effect);
		gameObjects.getItems().add(item);

		item = new Item("SHORT_SWORD", "Short sword",
				"A short sword, simple and somewhat rusted in places, but still sharp.");
		item.setEquipmentSlotId(EQUIPMENT_SLOT_R_HAND);
		item.setItemType(ITEM_TYPE_SWORD);
		item.setValue(10);
		effect = new Effect(ScriptBuilder.NEW().me()
				.modifyDamage(PHYSICAL, 2, 4).toString());
		item.getEquippedEffects().add(effect);
		effect = new Effect(ScriptBuilder.NEW().me()
				.modifyDerivate(D_ATTACK_STAMINA_COST, 1).toString());
		item.getEquippedEffects().add(effect);
		gameObjects.getItems().add(item);

		item = new Item(
				"HEALING_POTION",
				"Healing potion",
				"Magical elixir in a glass bottle. It has the color of honey and a pleasantly refreshing herbal taste.");
		item.setValue(10);
		gameObjects.getItems().add(item);

		useOption = new GenericOption();
		useOption.setLabel("Drink");
		useOption.getEffects().add(
				EffectBuilder.NEW().me().removeCurrentItem().compileEffect());
		useOption.getEffects().add(
				EffectBuilder.NEW().me().increaseStat(HEALTH, 50)
						.compileEffect());
		useOption
				.setTextAfter("You drink the healing potion in a single gulp. Yummie!");
		useOption.setConsumesCombatAction(true);
		useOption.setGoToSituation(ST_EMPTY_RETURN);
		item.getUseOptions().add(useOption);

		return gameObjects;
	}

}
